UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0mNeDTPxzgLSb3RXmv708qQfi49yzPWzvw2ibb8zDLs='
WHERE
key_id = '8d6e3fe9becf582b3e4cbaa1c7ee6e2218456fee1ad950b1c326716a3b7b1dbe'
AND (
token = '0mNeDTPxzgLSb3RXmv708qQfi49yzPWzvw2ibb8zDLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)