UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z2mMH5XcyF9txn64sz8Zy30A/1aLFoid7laW082H8L8=' 
WHERE 
  key_id = 'ab064c736fe557efee0ad23818eef583e1875f770246dfe80bdddc7d447577fa' 
  AND (
    token = 'Z2mMH5XcyF9txn64sz8Zy30A/1aLFoid7laW082H8L8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023