UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0CwgJXiIBl9jlcRybwDTDYDcmLROxSPm6SiZGz94BbE='
WHERE
key_id = '212353359d30979464cc21cb9bd1b5f2cc4bdb20d619b491659c6e35b08b5e5f'
AND (
token = '0CwgJXiIBl9jlcRybwDTDYDcmLROxSPm6SiZGz94BbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)