UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5gI8tFzkPb8c6r2QO8rGlPK8bidHEsW+34PCXwuzf6c=' 
WHERE 
  key_id = 'b808ba683a978df301a275d8541519d9e616dde010c2c6390769e4f18100e10c' 
  AND (
    token = '5gI8tFzkPb8c6r2QO8rGlPK8bidHEsW+34PCXwuzf6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026