UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDq102NmBuo0xkhQN+btbz8AlXLmzMBtB0ZkHFxjDzE=' 
WHERE 
  key_id = '25291d82848c1a1f5c0bfe62f5860a69099eb99ea1425412a1e3b86d6b6d8e45' 
  AND (
    token = 'pDq102NmBuo0xkhQN+btbz8AlXLmzMBtB0ZkHFxjDzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032