UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r7UuwLYQ2jf94vJdSdWAJCMNsJ2O8U1yyPgkoJS9usU='
WHERE
key_id = '925d1c15ea36c1a3af967c4bec776c8f1ae72fc1a213524326379d891a05fc1d'
AND (
token = 'r7UuwLYQ2jf94vJdSdWAJCMNsJ2O8U1yyPgkoJS9usU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)