UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SIWigVV2Yo5GT/OGmJMFHoTZ7oD857dPji/XXYjqeCY='
WHERE
key_id = 'cda57016f7b89272ad6cf4793ca292ef3ebf85e6938438241d0395b2c2353259'
AND (
token = 'SIWigVV2Yo5GT/OGmJMFHoTZ7oD857dPji/XXYjqeCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)