UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K23TwqmVPD5AjNqXzkqBgZ280b6VM9qR0oVpeIHROAw=' 
WHERE 
  key_id = '8fbb3685f6cfebcfc40868d202b5d4809ee9c1dda82413d59ede7df8f3a9e82c' 
  AND (
    token = 'K23TwqmVPD5AjNqXzkqBgZ280b6VM9qR0oVpeIHROAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017