UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWLdRNCNIWET8zClxlzZ/v81+Btz3HmW8pi3ooEFP1k='
WHERE
key_id = 'a408a0194a6e8393e6b00a221029282c3e80d19bd04a07876fe1a261c8b64a8c'
AND (
token = 'VWLdRNCNIWET8zClxlzZ/v81+Btz3HmW8pi3ooEFP1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)