UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fcumcizN036tQtUK/qnGhrQtH2Sp9pFWMHyWMWt8dns='
WHERE
key_id = '17c156abf240cd80819aecbbd8e7e6bcb2344590c2c61dfffec4ff20b55ab48a'
AND (
token = 'fcumcizN036tQtUK/qnGhrQtH2Sp9pFWMHyWMWt8dns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)