UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxT5ThQ67NCu4TSMhwJGfQ3t8olscCkSMhYE9Q5gLe4=' 
WHERE 
  key_id = 'f72cb3eae081b7b448eb001d88bde6fae8a4c82ecb926dd2ac6c6bbffd5fa7cf' 
  AND (
    token = 'rxT5ThQ67NCu4TSMhwJGfQ3t8olscCkSMhYE9Q5gLe4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045