UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FelXNkd2rrHkGNtzwpQecHMDvDY/A9YyQ48l4cEeAK8=' 
WHERE 
  key_id = '38f0dbcf7a014a8975cf20aadfd8fcfe82fe9d0a2f70b7225f28eb1065d1bb3a' 
  AND (
    token = 'FelXNkd2rrHkGNtzwpQecHMDvDY/A9YyQ48l4cEeAK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038