UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DM8YQ9jZOWcYexnJIgE7DOJvN+KQc+Q2cph5k/ca6oM='
WHERE
key_id = 'c3da4dae782e105eb8170f3a602b77f9fb39d0dfa8b794bd60f7e41b814972be'
AND (
token = 'DM8YQ9jZOWcYexnJIgE7DOJvN+KQc+Q2cph5k/ca6oM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)