UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hzrohqQtOay+Xehy8lHRMIIio512aFDHZZ5jc0YRxyk='
WHERE
key_id = 'd89618d6e251fea29f1fc077a6885178142a6b76eae00cfc90628315d2fceed4'
AND (
token = 'hzrohqQtOay+Xehy8lHRMIIio512aFDHZZ5jc0YRxyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)