UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWCFkMNEkPl+nbpwjjbUuQNeYJHlvBfGrnV3SgKto/0='
WHERE
key_id = 'dd81bc573afc6ea6e39d7a93412468efc28d6699b7dc7edbb8fe6e57342d94b4'
AND (
token = 'hWCFkMNEkPl+nbpwjjbUuQNeYJHlvBfGrnV3SgKto/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)