UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35c9GRuCR2jg9gLTjYxlyTf11tQXEF/GswY5AEZXfbM=' 
WHERE 
  key_id = '9051793f34ab2e366ede060d80ab326f96d524caf254b0a4987507df266d4f99' 
  AND (
    token = '35c9GRuCR2jg9gLTjYxlyTf11tQXEF/GswY5AEZXfbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021