UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XNj0It6WHYNQrZvGGKtPml0UmtIzM133/OEEmAEWuyQ=' 
WHERE 
  key_id = '71bda77773455200a8210f51b3437b068f75854ab7b032cbc97eec4b43269588' 
  AND (
    token = 'XNj0It6WHYNQrZvGGKtPml0UmtIzM133/OEEmAEWuyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015