UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SneHg7UhLiuFv9XZfmHKlMY/gFhe9Y6fgk+uPBoru1w=' 
WHERE 
  key_id = 'e9fe9663390a61f60bb16456df8ea617df437ff3602b1f9af69de3fa1c1fb3a7' 
  AND (
    token = 'SneHg7UhLiuFv9XZfmHKlMY/gFhe9Y6fgk+uPBoru1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054