UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FXn+UeLifYq/48Dk9NNN0sDhOeqrsSibv+/N96ckiyU=' 
WHERE 
  key_id = 'a4b23463c0ecc85d599445753f46db34117252d3a4661bd1687e8997cb15069b' 
  AND (
    token = 'FXn+UeLifYq/48Dk9NNN0sDhOeqrsSibv+/N96ckiyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019