UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2uDaF21j+M6hTIAp8idw8ZjyGbTg0RyvDgTF4UJ5MGU=' 
WHERE 
  key_id = 'a8b3684933ad358bec731490636283026f65904266339d45f7c392db63fb900d' 
  AND (
    token = '2uDaF21j+M6hTIAp8idw8ZjyGbTg0RyvDgTF4UJ5MGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043