UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JUGVE7kTVlhR9lKXSInsPuhPk0J6W/BS250nYpdbFYo=' 
WHERE 
  key_id = '6c46772a1a51ce9f1086c4e991bd1c88f7747e8b05b2c231c8559d89c7b7c34e' 
  AND (
    token = 'JUGVE7kTVlhR9lKXSInsPuhPk0J6W/BS250nYpdbFYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040