UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WYyp5PhIco/hyt0T2541XpUbpfVzvLQ1HK9m2BEG04I='
WHERE
key_id = '45490c82d2273417bf73fbf9ce2f3d1d0fdbe728fbb92f4bd7e242a343b8f6a7'
AND (
token = 'WYyp5PhIco/hyt0T2541XpUbpfVzvLQ1HK9m2BEG04I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)