UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BbkHOZeUKLUdl0ynBpzx5iG47lLgQIq5vGP5+P92E2w=' 
WHERE 
  key_id = '760f93940c54b96214b262242ec975cc375b6ce3aff2ef24527bf349ba5acd3d' 
  AND (
    token = 'BbkHOZeUKLUdl0ynBpzx5iG47lLgQIq5vGP5+P92E2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031