UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+DNOxuNFZXa4PwhMlWSMpRIBVaEDQ3RoQGAFRq+vzT8=' 
WHERE 
  key_id = 'a5da6f6f640ba0fad8c9d007538e6bafb6145025601e9874f3e849551d1f8dc6' 
  AND (
    token = '+DNOxuNFZXa4PwhMlWSMpRIBVaEDQ3RoQGAFRq+vzT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027