UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UaiApIYPRfFoph4JFT6bafTMqn7FzMGQ5Uz/BH6R85U=' 
WHERE 
  key_id = '822e2c4f03ceacab4dbf167bf456fce17c31b6ff3177d19473ffaa953547d5ae' 
  AND (
    token = 'UaiApIYPRfFoph4JFT6bafTMqn7FzMGQ5Uz/BH6R85U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026