UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XaVj0W57luUvE1PWByegV7haftjIB9CdpvDd5Tv/bDg='
WHERE
key_id = 'a335a055d3a969092e4ce00babc828960b859cfa1e3c3e97ed5a2192becd834a'
AND (
token = 'XaVj0W57luUvE1PWByegV7haftjIB9CdpvDd5Tv/bDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)