UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Km9WtJHG+Jp6BCh6tt/e77QzfJwBzMXt1gB/w5TXMsc='
WHERE
key_id = 'cb2c816b6726b489a906ce4f6636bea03a8f2e5b72cb6b99b3ef622908fddeb5'
AND (
token = 'Km9WtJHG+Jp6BCh6tt/e77QzfJwBzMXt1gB/w5TXMsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)