UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nd9iJKf08EafC6nsMTAK2ikandp9zrV6dw1YIN63yRU='
WHERE
key_id = '12eac14d5ccefbabb0be0c1fd0e7fa3fabaa79a1598712eaf936fac307b98f07'
AND (
token = 'nd9iJKf08EafC6nsMTAK2ikandp9zrV6dw1YIN63yRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)