UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FzWX2zBR6RozRHXdE7ZUYLJuunfdrXFbh88F5+KKwk=' 
WHERE 
  key_id = '18885333b7cff2d8726e5c49ce1b92698e66ee4df0b5a237f3f57afc5381374b' 
  AND (
    token = '4FzWX2zBR6RozRHXdE7ZUYLJuunfdrXFbh88F5+KKwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034