UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOPbVW4js/+C0FUr/xqh8er/9GVUBKSV9sTBdc/WnpQ=' 
WHERE 
  key_id = '395e07e09039ae83d82fb8b2db6f69f31876201fcbf3343e7392eb421245f10c' 
  AND (
    token = 'jOPbVW4js/+C0FUr/xqh8er/9GVUBKSV9sTBdc/WnpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031