UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vyCJERfrqjVIJa5h9DDrG3QDrIggIe0ScvVOeVyoKB0='
WHERE
key_id = '438c7ca1773ee34b9a97cd84e429b64a38281aad4f81e6229d269fffb88cc9ac'
AND (
token = 'vyCJERfrqjVIJa5h9DDrG3QDrIggIe0ScvVOeVyoKB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)