UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUFdWm8O1r+tIj4KdDRVpX3WJdN9lRLNFITaO3Lp+aY='
WHERE
key_id = '844f534f7b995b1fb2e85492706a0df25cf841f5c3ba0aa6b7fe371fbdc04d16'
AND (
token = 'SUFdWm8O1r+tIj4KdDRVpX3WJdN9lRLNFITaO3Lp+aY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)