UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Fw8S08gf3xtVmy9WSVgelZ4tSIO9RgnAG7tLsdw5lM=' 
WHERE 
  key_id = '725d3bae685c5755ac16437a8c08e2077613acfdc10238969a4205a5baffec16' 
  AND (
    token = '3Fw8S08gf3xtVmy9WSVgelZ4tSIO9RgnAG7tLsdw5lM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051