UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vlPUE6xUghCRdvekbd/tErWEIbaeEXs4bHnDP5NI5h8=' 
WHERE 
  key_id = '3576dcc87ce0f8e10634ad664f858d02f4de4ff710333b91469af94f654142ef' 
  AND (
    token = 'vlPUE6xUghCRdvekbd/tErWEIbaeEXs4bHnDP5NI5h8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025