UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'duJsi02Rc9I780JANb6XNhK0ZwjzjouBby+boT5LVm0=' 
WHERE 
  key_id = '75af43604f3ec3ca392b864f53de522416c15d43e840c75666a7dd4cbf492a52' 
  AND (
    token = 'duJsi02Rc9I780JANb6XNhK0ZwjzjouBby+boT5LVm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045