UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/oo6yyTBEcQ/FnROjaBA7+jX4iGw1RbeZ7/EeqFBONg='
WHERE
key_id = '2dbf7d7ee20cd1f5d56988a07a57cec780393f9d90eaac76da36eb1f77c0e947'
AND (
token = '/oo6yyTBEcQ/FnROjaBA7+jX4iGw1RbeZ7/EeqFBONg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)