UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xeVmiRl4ke+2YBBPB4Tm7Yu1HdkT+aOHUbLUPonq3vM='
WHERE
key_id = 'e6487453b324f869f3e302c41fc996a0fee1e0d64913b4e1a7ebad6a74174a11'
AND (
token = 'xeVmiRl4ke+2YBBPB4Tm7Yu1HdkT+aOHUbLUPonq3vM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)