UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XijeIG92/kyDNpKzd9OrG9gCP0A9CEbojbNUTtdvAzA=' 
WHERE 
  key_id = '0ff9bdbc81ba153be53a8e39d5deb39994eca3c7ca8e29bf23c62eca895b5cb4' 
  AND (
    token = 'XijeIG92/kyDNpKzd9OrG9gCP0A9CEbojbNUTtdvAzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031