UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lvh72NWkB2DfiEsFp87VZ/6e2NKtsq0Uy11nNf4AYis=' 
WHERE 
  key_id = 'f1bdaa71bdbabe4110f4df813dac11a7ec5a6d58c95b60902e2f24cacd802c78' 
  AND (
    token = 'Lvh72NWkB2DfiEsFp87VZ/6e2NKtsq0Uy11nNf4AYis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024