UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VVpwpP8LugMsJW29Lga80Kjz2kGqqglKUSq5n9YGok0=' 
WHERE 
  key_id = 'b05c6a77e8895a37a563add2da107636ecc18b064c2c36d2d6b2471aeea7c727' 
  AND (
    token = 'VVpwpP8LugMsJW29Lga80Kjz2kGqqglKUSq5n9YGok0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034