UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G0ODfMZZD0Iz7PkSuuyO/JaqWIrhnM/LfWaF/wjgSR4='
WHERE
key_id = 'acf769fc0af0e2ce495b26e1bf46b97d57414c97d926b5d830e27c0a0efd97f9'
AND (
token = 'G0ODfMZZD0Iz7PkSuuyO/JaqWIrhnM/LfWaF/wjgSR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)