UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wRxkqpYF1vb5ciOawNSKZqAxUhKeQ35Fw34qo9Ra79I=' 
WHERE 
  key_id = '000963a2f22ab14d887d0306e23ec9e3d13826ffe80b74cd78efad1d93a706a1' 
  AND (
    token = 'wRxkqpYF1vb5ciOawNSKZqAxUhKeQ35Fw34qo9Ra79I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020