UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hs2iby8LFsfjCGf5GjMAIzx3UB0tWTvFOD0Nbr99Xxw=' 
WHERE 
  key_id = '0027411aa0e4dbbae76abf7e19bec00d1b7fa1f675dddc02b4d62e225b660eba' 
  AND (
    token = 'hs2iby8LFsfjCGf5GjMAIzx3UB0tWTvFOD0Nbr99Xxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018