UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QZLPxe26sC8pJyFEX2XekWcpymNu3/qWqSeN9yPfC9Y='
WHERE
key_id = '278e4a52aaeb381df016d3867cadd2d33ae899a658bc4ad76948278929319157'
AND (
token = 'QZLPxe26sC8pJyFEX2XekWcpymNu3/qWqSeN9yPfC9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)