UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M/yGbOLfK0V6QSMSjD8jwfmrGN9C1ySXaGzY648N+Y0='
WHERE
key_id = '3ea8bd72e6cd94fc597286a5f375cad29f7bf0f0a1e1040aa493e4206cec9c76'
AND (
token = 'M/yGbOLfK0V6QSMSjD8jwfmrGN9C1ySXaGzY648N+Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)