UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bir/J/0LDhf26Zj0nT83aonekftjdHmg0CtixfF4nEM=' 
WHERE 
  key_id = '9c51406c4d6e44ec1473db4fcbe0fbef34a3c17ec651802cee3e7fd717d7966e' 
  AND (
    token = 'bir/J/0LDhf26Zj0nT83aonekftjdHmg0CtixfF4nEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017