UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vmob+U9r644Z1+AW6GzBZhEV8/8taQeCbVc4CX0ginA=' 
WHERE 
  key_id = '0408011f3923b54b34ae4030e200d2fb56d2c222660ab066b2a36b87869c0af7' 
  AND (
    token = 'Vmob+U9r644Z1+AW6GzBZhEV8/8taQeCbVc4CX0ginA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057