UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fwCnvb4WiFc/GIN5GVVEPUe5Dv4X/5LYLxRAEnzcnLQ=' 
WHERE 
  key_id = 'ad95ad724066c8009f35a311f11361d4ed04a78c60fb1e4a88e60ad32198dd78' 
  AND (
    token = 'fwCnvb4WiFc/GIN5GVVEPUe5Dv4X/5LYLxRAEnzcnLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021