UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ne0TwkmbTBjnxqzyB3NoKRrdYFZwt637IluAxoGUa88=' 
WHERE 
  key_id = '39d715402e15722214cf65165a40bf48caa826386ed261b7aa68a0c75247c183' 
  AND (
    token = 'Ne0TwkmbTBjnxqzyB3NoKRrdYFZwt637IluAxoGUa88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037