UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3RQnkW2BJnLVvCDuvD5jMEk41W4FMJQJa73XYOGYf0M='
WHERE
key_id = '74197490f867d9f404e9aa2b8364eeeb8522ef396aee6bdbc8b8855477237f52'
AND (
token = '3RQnkW2BJnLVvCDuvD5jMEk41W4FMJQJa73XYOGYf0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)